package main

import (
    "fmt"
)

func main() {
    a1 := [...]int{1, 2, 3}
    fmt.Println(a1)

    s1 := []int{1, 2, 3}
    fmt.Println(s1)

    m1 := map[int]int{1: 1, 2: 2, 3: 3}
    fmt.Println(m1)

    // a2 := make([3]int)  //make can't be used to create array
    // fmt.Println(a2)

    s2 := make([]int, 3) //values in slice will be initialized to default value of the type, here is 0
    fmt.Println(s2)

    m2 := make(map[int]int)
    fmt.Println(m2)
    value, ok := m2[1]
    fmt.Println(value, ok)

    // m3 := make(map[int]int){1:1,2:2}    //can't use initializaton syntax with make
    // fmt.Println(m3)

    // t := [1,2,3]    //can't use javascript array syntax
    // fmt.Println(t)

    //declaration will also create the array, just as C++, Not a null reference as C# or python
    //all values will be set default, here is 0
    var a3 [3]int
    fmt.Println(a3)

    //declaration will also create the slice, just as C++, Not a null reference as C# or python
    var s3 []int
    fmt.Println(s3)

    //declaration will also create the map, just as C++, Not a null or None reference as in javascript or python
    var m3 map[int]int
    var pm3 *map[int]int = &m3
    fmt.Println(m3)
    fmt.Println(pm3)
    //here make create a new map, and the assignment is value copy NOT reference copy
    //so m3's address stays the same, NOT changed to the address of the new map
    //only values in new map are copied to m3
    m3 = make(map[int]int)
    fmt.Println(m3)
    fmt.Println(pm3 == &m3)

    //the declearation and assignment are the same as C++
}
